/*
 * @Author: your name
 * @Date: 2022-03-24 22:00:28
 * @LastEditTime: 2022-05-03 08:49:54
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \VScodeToWeb\bookWebApi\routes\users.js
 */
var express = require('express')
var router = express.Router()

const user = require('../controller/user')
const common = require('../util/common')

/* GET users listing. */
router.get('/', user.findAll)

// 注册
router.post('/register', user.register)

//登录
router.post('/login', user.login)

//登出
router.get('/logout', common.checkLogin, user.logout)

module.exports = router
